{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "525e253d-625d-4fdb-932f-082c84e17e8c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                                  2022\n",
      "\n",
      "      January                   February                   March\n",
      "Mo Tu We Th Fr Sa Su      Mo Tu We Th Fr Sa Su      Mo Tu We Th Fr Sa Su\n",
      "                1  2          1  2  3  4  5  6          1  2  3  4  5  6\n",
      " 3  4  5  6  7  8  9       7  8  9 10 11 12 13       7  8  9 10 11 12 13\n",
      "10 11 12 13 14 15 16      14 15 16 17 18 19 20      14 15 16 17 18 19 20\n",
      "17 18 19 20 21 22 23      21 22 23 24 25 26 27      21 22 23 24 25 26 27\n",
      "24 25 26 27 28 29 30      28                        28 29 30 31\n",
      "31\n",
      "\n",
      "       April                      May                       June\n",
      "Mo Tu We Th Fr Sa Su      Mo Tu We Th Fr Sa Su      Mo Tu We Th Fr Sa Su\n",
      "             1  2  3                         1             1  2  3  4  5\n",
      " 4  5  6  7  8  9 10       2  3  4  5  6  7  8       6  7  8  9 10 11 12\n",
      "11 12 13 14 15 16 17       9 10 11 12 13 14 15      13 14 15 16 17 18 19\n",
      "18 19 20 21 22 23 24      16 17 18 19 20 21 22      20 21 22 23 24 25 26\n",
      "25 26 27 28 29 30         23 24 25 26 27 28 29      27 28 29 30\n",
      "                          30 31\n",
      "\n",
      "        July                     August                  September\n",
      "Mo Tu We Th Fr Sa Su      Mo Tu We Th Fr Sa Su      Mo Tu We Th Fr Sa Su\n",
      "             1  2  3       1  2  3  4  5  6  7                1  2  3  4\n",
      " 4  5  6  7  8  9 10       8  9 10 11 12 13 14       5  6  7  8  9 10 11\n",
      "11 12 13 14 15 16 17      15 16 17 18 19 20 21      12 13 14 15 16 17 18\n",
      "18 19 20 21 22 23 24      22 23 24 25 26 27 28      19 20 21 22 23 24 25\n",
      "25 26 27 28 29 30 31      29 30 31                  26 27 28 29 30\n",
      "\n",
      "      October                   November                  December\n",
      "Mo Tu We Th Fr Sa Su      Mo Tu We Th Fr Sa Su      Mo Tu We Th Fr Sa Su\n",
      "                1  2          1  2  3  4  5  6                1  2  3  4\n",
      " 3  4  5  6  7  8  9       7  8  9 10 11 12 13       5  6  7  8  9 10 11\n",
      "10 11 12 13 14 15 16      14 15 16 17 18 19 20      12 13 14 15 16 17 18\n",
      "17 18 19 20 21 22 23      21 22 23 24 25 26 27      19 20 21 22 23 24 25\n",
      "24 25 26 27 28 29 30      28 29 30                  26 27 28 29 30 31\n",
      "31\n"
     ]
    }
   ],
   "source": [
    "import calendar\n",
    "import locale\n",
    "textcal = calendar.TextCalendar() #创建文本日历\n",
    "textcal.pryear(2022)              #打印2022年一年的日历 \n",
    "loc = locale.getlocale()                               #获取当前系统的locale（本地化配置）\n",
    "localtextcal = calendar.LocaleTextCalendar(locale=loc) #返回指定locale的月份和星期信息\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b1fe8adc-cd56-4ead-a3b7-14d957e9dd38",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
